/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.brain.sgc.dto;

import com.brain.core.dto.ParametroDto;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.validation.constraints.Size;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "TSGC_IDIOMA")
public class IdiomaDto implements Serializable {
    private static long serialVersionUID = 1L;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public static void setSerialVersionUID(long aSerialVersionUID) {
        serialVersionUID = aSerialVersionUID;
    }
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "SEQ_IDIOMA")
    @TableGenerator(name = "SEQ_IDIOMA", table = "TCORE_ENTIDAD", pkColumnName = "NOMBRE", valueColumnName = "CORRELATIVO", pkColumnValue = "IDIOMA", allocationSize = 1)
    private Long id;
    @JoinColumn(name = "PERSONA", referencedColumnName = "ID")
    @ManyToOne
    private PersonaDto personaDto;
    @Size(max = 150)
    @Column(name = "TITULO")
    private String titulo;
    @Column(name="ESCRITO")
    private String escrito;
    @Column(name="ORAL")
    private String oral;
    @JoinColumn(name = "IDIOMA", referencedColumnName = "ID")
    @ManyToOne
    private ParametroDto idiomaDto;

    public IdiomaDto() {
    }

    public IdiomaDto(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    
    @Override
    public String toString() {
        return "com.brain.sgc.dto.IdiomaDto[ id=" + id + " ]";
    }

    public PersonaDto getPersonaDto() {
        return personaDto;
    }

    public void setPersonaDto(PersonaDto personaDto) {
        this.personaDto = personaDto;
    }

    public String getTitulo() {
        return titulo;
    }

    public void setTitulo(String titulo) {
        this.titulo = titulo;
    }

    public String getEscrito() {
        return escrito;
    }

    public void setEscrito(String escrito) {
        this.escrito = escrito;
    }

    public String getOral() {
        return oral;
    }

    public void setOral(String oral) {
        this.oral = oral;
    }

    public ParametroDto getIdiomaDto() {
        return idiomaDto;
    }

    public void setIdiomaDto(ParametroDto idiomaDto) {
        this.idiomaDto = idiomaDto;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof IdiomaDto)) {
            return false;
        }
        IdiomaDto other = (IdiomaDto) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }
}